/*
 * Doctor.java
 */
package edu.gatech.oad.user;

import java.util.Set;
import java.util.HashSet;

import edu.gatech.oad.schedule.Appointment;

public class Doctor extends MedicalPersonnel {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private final Set<Appointment> appointments = new HashSet<Appointment>();
		
	public Doctor(String username) {
		super(username);
	}
	
	public Doctor(String username, String password) {
		super(username, password);
	}
	
	/**
	 * @return the appointments
	 */
	public Set<Appointment> getAppointments() {
		return appointments;
	}
	
	/**
	 * Adds the appointment to the doctor's list of appointments.
	 * @param appointment
	 */
	public void scheduleAppointment(Appointment appointment) {
		assert appointment.getDoctor() == null;
		appointment.setDoctor(this);
		this.appointments.add(appointment);
	}
	
	public String toString() {
		return "Doctor: " + super.toString();
	}
}
